package com.example.test.qtnet

import com.example.test.support.QianToonApiUtil
import com.example.test.support.QiantoonNetworkApi
import com.google.gson.Gson
import okhttp3.RequestBody


/**
 * @Package com.example.test.qtnet
 * @ClassName ApiWrapper
 * @Author caostgrace
 * @Date 2021/4/9
 * @Email liaobing@qiantoon.com
 * @Desc
 */
class ApiWrapper {

    suspend fun queryInvoiceTitleList(page:String,size:String):BaseResponseBean{
        return QiantoonNetworkApi.getService(ApiService::class.java)
                .queryInvoiceTitleList(page,size)
    }

    suspend fun test():BaseResponseBean{

        val paramsMap = HashMap<String, Any>()
        paramsMap.apply {
            put("HeadName", "headName")
        }

        val requestBody = RequestBody.create(QianToonApiUtil.getDefaultMediaType(), Gson().toJson(paramsMap))

        return QiantoonNetworkApi.getService(ApiService::class.java)
                .test(requestBody)
    }
}